<!-- HTML header for doxygen 1.8.3.1-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.3.1"/>
<title>Sifteo SDK: Sifteo::BitArray&lt; tSize &gt; Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-style-overrides.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<center>
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Sifteo SDK" src="sdk_logo.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">
   &#160;<span id="projectnumber">v1.0.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
</center>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.3.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Home</span></a></li>
      <li><a href="pages.html"><span>Guides</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="annotated.html"><span>Reference</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>Sifteo</b></li><li class="navelem"><a class="el" href="class_sifteo_1_1_bit_array.html">BitArray</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="class_sifteo_1_1_bit_array-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">Sifteo::BitArray&lt; tSize &gt; Class Template Reference<div class="ingroups"><a class="el" href="group__array.html">Array</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>A fixed-size array of bits, with compact storage and fast iteration.  
 <a href="class_sifteo_1_1_bit_array.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="array_8h_source.html">sifteo/array.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_bit_array_1_1iterator.html">iterator</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">An STL-style iterator for the <a class="el" href="class_sifteo_1_1_bit_array.html" title="A fixed-size array of bits, with compact storage and fast iteration.">BitArray</a>.  <a href="struct_sifteo_1_1_bit_array_1_1iterator.html#details">More...</a><br/></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:abaf8764c94ae4f4fc241db2146a45802"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abaf8764c94ae4f4fc241db2146a45802"></a>
<a class="el" href="struct_sifteo_1_1_bit_array_1_1iterator.html">iterator</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sifteo_1_1_bit_array.html#abaf8764c94ae4f4fc241db2146a45802">begin</a> () const </td></tr>
<tr class="memdesc:abaf8764c94ae4f4fc241db2146a45802"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return an STL-style iterator for this array. <br/></td></tr>
<tr class="separator:abaf8764c94ae4f4fc241db2146a45802"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8f65fb64bc04e821bbf95d0c36f9b45e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8f65fb64bc04e821bbf95d0c36f9b45e"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sifteo_1_1_bit_array.html#a8f65fb64bc04e821bbf95d0c36f9b45e">BitArray</a> ()</td></tr>
<tr class="memdesc:a8f65fb64bc04e821bbf95d0c36f9b45e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a new empty <a class="el" href="class_sifteo_1_1_bit_array.html" title="A fixed-size array of bits, with compact storage and fast iteration.">BitArray</a>. <br/></td></tr>
<tr class="separator:a8f65fb64bc04e821bbf95d0c36f9b45e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac78047e020a7293485b3fbef7af6adb7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac78047e020a7293485b3fbef7af6adb7"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sifteo_1_1_bit_array.html#ac78047e020a7293485b3fbef7af6adb7">BitArray</a> (unsigned index)</td></tr>
<tr class="memdesc:ac78047e020a7293485b3fbef7af6adb7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a new <a class="el" href="class_sifteo_1_1_bit_array.html" title="A fixed-size array of bits, with compact storage and fast iteration.">BitArray</a> with a single bit marked. <br/></td></tr>
<tr class="separator:ac78047e020a7293485b3fbef7af6adb7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1251e6bc66993b314aed3e3a26dbdfe3"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sifteo_1_1_bit_array.html#a1251e6bc66993b314aed3e3a26dbdfe3">BitArray</a> (unsigned <a class="el" href="class_sifteo_1_1_bit_array.html#abaf8764c94ae4f4fc241db2146a45802">begin</a>, unsigned <a class="el" href="class_sifteo_1_1_bit_array.html#a261a2f960102911cd5164e8479dd2e95">end</a>)</td></tr>
<tr class="memdesc:a1251e6bc66993b314aed3e3a26dbdfe3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a new <a class="el" href="class_sifteo_1_1_bit_array.html" title="A fixed-size array of bits, with compact storage and fast iteration.">BitArray</a> with a range of bits marked.  <a href="#a1251e6bc66993b314aed3e3a26dbdfe3">More...</a><br/></td></tr>
<tr class="separator:a1251e6bc66993b314aed3e3a26dbdfe3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae8145858712c6b2b814603bc18d80023"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae8145858712c6b2b814603bc18d80023"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sifteo_1_1_bit_array.html#ae8145858712c6b2b814603bc18d80023">clear</a> (unsigned index)</td></tr>
<tr class="memdesc:ae8145858712c6b2b814603bc18d80023"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clear (set to 0) a single bit. <br/></td></tr>
<tr class="separator:ae8145858712c6b2b814603bc18d80023"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a168b3f3833fbc236d9f1104021eb5727"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a168b3f3833fbc236d9f1104021eb5727"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sifteo_1_1_bit_array.html#a168b3f3833fbc236d9f1104021eb5727">clear</a> ()</td></tr>
<tr class="memdesc:a168b3f3833fbc236d9f1104021eb5727"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clear (set to 0) all bits in the array. <br/></td></tr>
<tr class="separator:a168b3f3833fbc236d9f1104021eb5727"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6f989182ac2faef2a7ce7d58f3648651"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sifteo_1_1_bit_array.html#a6f989182ac2faef2a7ce7d58f3648651">clearFirst</a> (unsigned &amp;index)</td></tr>
<tr class="memdesc:a6f989182ac2faef2a7ce7d58f3648651"><td class="mdescLeft">&#160;</td><td class="mdescRight">Find and clear the lowest marked bit.  <a href="#a6f989182ac2faef2a7ce7d58f3648651">More...</a><br/></td></tr>
<tr class="separator:a6f989182ac2faef2a7ce7d58f3648651"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a206da86fd30434a7c9acbb68d8b88a87"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sifteo_1_1_bit_array.html#a206da86fd30434a7c9acbb68d8b88a87">clearN</a> (unsigned &amp;index, unsigned n)</td></tr>
<tr class="memdesc:a206da86fd30434a7c9acbb68d8b88a87"><td class="mdescLeft">&#160;</td><td class="mdescRight">Find and clear the Nth lowest marked bit.  <a href="#a206da86fd30434a7c9acbb68d8b88a87">More...</a><br/></td></tr>
<tr class="separator:a206da86fd30434a7c9acbb68d8b88a87"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a17b83acbfcdda8e8aef265230d11f5ef"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a17b83acbfcdda8e8aef265230d11f5ef"></a>
unsigned&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sifteo_1_1_bit_array.html#a17b83acbfcdda8e8aef265230d11f5ef">count</a> () const </td></tr>
<tr class="memdesc:a17b83acbfcdda8e8aef265230d11f5ef"><td class="mdescLeft">&#160;</td><td class="mdescRight">How many bits are marked in this vector? <br/></td></tr>
<tr class="separator:a17b83acbfcdda8e8aef265230d11f5ef"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab7ee5cc04a70eca1d0f1a912a18128e6"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab7ee5cc04a70eca1d0f1a912a18128e6"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sifteo_1_1_bit_array.html#ab7ee5cc04a70eca1d0f1a912a18128e6">empty</a> () const </td></tr>
<tr class="memdesc:ab7ee5cc04a70eca1d0f1a912a18128e6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Is every bit in this array set to zero? <br/></td></tr>
<tr class="separator:ab7ee5cc04a70eca1d0f1a912a18128e6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a261a2f960102911cd5164e8479dd2e95"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a261a2f960102911cd5164e8479dd2e95"></a>
<a class="el" href="struct_sifteo_1_1_bit_array_1_1iterator.html">iterator</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sifteo_1_1_bit_array.html#a261a2f960102911cd5164e8479dd2e95">end</a> () const </td></tr>
<tr class="memdesc:a261a2f960102911cd5164e8479dd2e95"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return an STL-style iterator for this array. <br/></td></tr>
<tr class="separator:a261a2f960102911cd5164e8479dd2e95"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a48ee924d9550cb9f61020cd49c2ef47b"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sifteo_1_1_bit_array.html#a48ee924d9550cb9f61020cd49c2ef47b">findFirst</a> (unsigned &amp;index) const </td></tr>
<tr class="memdesc:a48ee924d9550cb9f61020cd49c2ef47b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Find the lowest index where there's a marked (1) bit.  <a href="#a48ee924d9550cb9f61020cd49c2ef47b">More...</a><br/></td></tr>
<tr class="separator:a48ee924d9550cb9f61020cd49c2ef47b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6dbd2c0559e821615155f3e7f9881e36"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6dbd2c0559e821615155f3e7f9881e36"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sifteo_1_1_bit_array.html#a6dbd2c0559e821615155f3e7f9881e36">mark</a> (unsigned index)</td></tr>
<tr class="memdesc:a6dbd2c0559e821615155f3e7f9881e36"><td class="mdescLeft">&#160;</td><td class="mdescRight">Mark (set to 1) a single bit. <br/></td></tr>
<tr class="separator:a6dbd2c0559e821615155f3e7f9881e36"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afee073b09426b010401a0186ba00939f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afee073b09426b010401a0186ba00939f"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sifteo_1_1_bit_array.html#afee073b09426b010401a0186ba00939f">mark</a> ()</td></tr>
<tr class="memdesc:afee073b09426b010401a0186ba00939f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Mark (set to 1) all bits in the array. <br/></td></tr>
<tr class="separator:afee073b09426b010401a0186ba00939f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa2548e48ebb30595a6b128c3c030b96e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa2548e48ebb30595a6b128c3c030b96e"></a>
<a class="el" href="class_sifteo_1_1_bit_array.html">BitArray</a>&lt; tSize &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sifteo_1_1_bit_array.html#aa2548e48ebb30595a6b128c3c030b96e">operator&amp;</a> (const <a class="el" href="class_sifteo_1_1_bit_array.html">BitArray</a>&lt; tSize &gt; &amp;other) const </td></tr>
<tr class="memdesc:aa2548e48ebb30595a6b128c3c030b96e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Bitwise AND of two BitArrays of the same size. <br/></td></tr>
<tr class="separator:aa2548e48ebb30595a6b128c3c030b96e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaf166ed1269e85bd62a5731846dae919"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aaf166ed1269e85bd62a5731846dae919"></a>
<a class="el" href="class_sifteo_1_1_bit_array.html">BitArray</a>&lt; tSize &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sifteo_1_1_bit_array.html#aaf166ed1269e85bd62a5731846dae919">operator^</a> (const <a class="el" href="class_sifteo_1_1_bit_array.html">BitArray</a>&lt; tSize &gt; &amp;other) const </td></tr>
<tr class="memdesc:aaf166ed1269e85bd62a5731846dae919"><td class="mdescLeft">&#160;</td><td class="mdescRight">Bitwise XOR of two BitArrays of the same size. <br/></td></tr>
<tr class="separator:aaf166ed1269e85bd62a5731846dae919"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5be3df5332c1bcdf45752bb7710996e4"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5be3df5332c1bcdf45752bb7710996e4"></a>
<a class="el" href="class_sifteo_1_1_bit_array.html">BitArray</a>&lt; tSize &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sifteo_1_1_bit_array.html#a5be3df5332c1bcdf45752bb7710996e4">operator|</a> (const <a class="el" href="class_sifteo_1_1_bit_array.html">BitArray</a>&lt; tSize &gt; &amp;other) const </td></tr>
<tr class="memdesc:a5be3df5332c1bcdf45752bb7710996e4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Bitwise OR of two BitArrays of the same size. <br/></td></tr>
<tr class="separator:a5be3df5332c1bcdf45752bb7710996e4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af04f8395d541313028e511ff588fc053"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af04f8395d541313028e511ff588fc053"></a>
<a class="el" href="class_sifteo_1_1_bit_array.html">BitArray</a>&lt; tSize &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sifteo_1_1_bit_array.html#af04f8395d541313028e511ff588fc053">operator~</a> () const </td></tr>
<tr class="memdesc:af04f8395d541313028e511ff588fc053"><td class="mdescLeft">&#160;</td><td class="mdescRight">Negate a <a class="el" href="class_sifteo_1_1_bit_array.html" title="A fixed-size array of bits, with compact storage and fast iteration.">BitArray</a>, returning a new array in which each bit is inverted. <br/></td></tr>
<tr class="separator:af04f8395d541313028e511ff588fc053"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a77180bf4472794147a98d37b415acb32"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a77180bf4472794147a98d37b415acb32"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sifteo_1_1_bit_array.html#a77180bf4472794147a98d37b415acb32">test</a> (unsigned index) const </td></tr>
<tr class="memdesc:a77180bf4472794147a98d37b415acb32"><td class="mdescLeft">&#160;</td><td class="mdescRight">Is a particular bit marked? <br/></td></tr>
<tr class="separator:a77180bf4472794147a98d37b415acb32"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:aae91cb964cbd77ca7ba021d9c9ae3451"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aae91cb964cbd77ca7ba021d9c9ae3451"></a>
static unsigned&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sifteo_1_1_bit_array.html#aae91cb964cbd77ca7ba021d9c9ae3451">size</a> ()</td></tr>
<tr class="memdesc:aae91cb964cbd77ca7ba021d9c9ae3451"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieve the size of this array in bits, always constant at compile-time. <br/></td></tr>
<tr class="separator:aae91cb964cbd77ca7ba021d9c9ae3451"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template&lt;unsigned tSize&gt;<br/>
class Sifteo::BitArray&lt; tSize &gt;</h3>

<p>A fixed-size array of bits, with compact storage and fast iteration. </p>
<p>Supports arrays with any fixed-size number of bits. For sizes &lt;= 32 bits, this is just as efficient as using a bare uint32_t.</p>
<p>This is a Plain Old Data type, with no constructor.</p>
<p>The default value of the bits in a <a class="el" href="class_sifteo_1_1_bit_array.html" title="A fixed-size array of bits, with compact storage and fast iteration.">BitArray</a> is undefined. Initialize the <a class="el" href="class_sifteo_1_1_bit_array.html" title="A fixed-size array of bits, with compact storage and fast iteration.">BitArray</a> prior to use, for example by calling <a class="el" href="class_sifteo_1_1_bit_array.html#afee073b09426b010401a0186ba00939f" title="Mark (set to 1) all bits in the array.">mark()</a> or <a class="el" href="class_sifteo_1_1_bit_array.html#a168b3f3833fbc236d9f1104021eb5727" title="Clear (set to 0) all bits in the array.">clear()</a>.</p>
<p>BitArrays support iteration, through explicit method calls or via C++11 range-based for loops. </p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a1251e6bc66993b314aed3e3a26dbdfe3"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;unsigned tSize&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_sifteo_1_1_bit_array.html">Sifteo::BitArray</a>&lt; tSize &gt;::<a class="el" href="class_sifteo_1_1_bit_array.html">BitArray</a> </td>
          <td>(</td>
          <td class="paramtype">unsigned&#160;</td>
          <td class="paramname"><em>begin</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned&#160;</td>
          <td class="paramname"><em>end</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">explicit</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Create a new <a class="el" href="class_sifteo_1_1_bit_array.html" title="A fixed-size array of bits, with compact storage and fast iteration.">BitArray</a> with a range of bits marked. </p>
<p>This is a half-open interval. All bits &gt;= 'begin' and &lt; 'end' are marked. </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a6f989182ac2faef2a7ce7d58f3648651"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;unsigned tSize&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="class_sifteo_1_1_bit_array.html">Sifteo::BitArray</a>&lt; tSize &gt;::clearFirst </td>
          <td>(</td>
          <td class="paramtype">unsigned &amp;&#160;</td>
          <td class="paramname"><em>index</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Find and clear the lowest marked bit. </p>
<p>If we find any marked bits, returns true, sets "index" to that bit's index, and clears the bit. This can be used as part of an iteration pattern: </p>
<pre class="fragment">  unsigned index;
  while (vec.clearFirst(index)) {
      doStuff(index);
  }
</pre><p>This is functionally equivalent to <a class="el" href="class_sifteo_1_1_bit_array.html#a48ee924d9550cb9f61020cd49c2ef47b" title="Find the lowest index where there&#39;s a marked (1) bit.">findFirst()</a> followed by <a class="el" href="class_sifteo_1_1_bit_array.html#a168b3f3833fbc236d9f1104021eb5727" title="Clear (set to 0) all bits in the array.">clear()</a>, but it's a tiny bit more efficient. </p>

</div>
</div>
<a class="anchor" id="a206da86fd30434a7c9acbb68d8b88a87"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;unsigned tSize&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="class_sifteo_1_1_bit_array.html">Sifteo::BitArray</a>&lt; tSize &gt;::clearN </td>
          <td>(</td>
          <td class="paramtype">unsigned &amp;&#160;</td>
          <td class="paramname"><em>index</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned&#160;</td>
          <td class="paramname"><em>n</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Find and clear the Nth lowest marked bit. </p>
<p>For n=0, this is equivalent to <a class="el" href="class_sifteo_1_1_bit_array.html#a6f989182ac2faef2a7ce7d58f3648651" title="Find and clear the lowest marked bit.">clearFirst()</a>. For n=1, we skip the first marked bit and clear the second. And so on. If there is no Nth marked bit, returns false. </p>

</div>
</div>
<a class="anchor" id="a48ee924d9550cb9f61020cd49c2ef47b"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;unsigned tSize&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="class_sifteo_1_1_bit_array.html">Sifteo::BitArray</a>&lt; tSize &gt;::findFirst </td>
          <td>(</td>
          <td class="paramtype">unsigned &amp;&#160;</td>
          <td class="paramname"><em>index</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Find the lowest index where there's a marked (1) bit. </p>
<p>If any marked bits exist, returns true and puts the bit's index in "index". Iff the entire array is zero, returns false. </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="array_8h_source.html">array.h</a></li>
</ul>
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.3.1-->
<!-- start footer part -->
    <hr class="footer"/>
    <address class="footer">
        <p><a href="http://sifteo.com">Sifteo</a> SDK v1.0.0 <small>(see <a href="https://developers.sifteo.com/sifteosdk">all versions</a>)</small></p>
        <p>Last updated Wed Mar 27 2013, by <a href="http://www.stack.nl/~dimitri/doxygen">Doxygen</a></p>
    </address>
</body>
</html>
